package com.lois.ecommerce;

import lombok.Data;

@Data
public class Response {
    private int errcode;
    private String msg;
    private Object result;

    /**
     * 默认值<br>
     * errcode=0<br>
     * msg=成功
     */
    public Response() {
        this.errcode = ErrCode.SUC;
         this.msg = "成功";
    }

    /**
     * 默认值<br>
     * errcode=0<br>
     * msg=成功
     */
    public Response(Object reslut) {
        this.errcode = ErrCode.SUC;
         this.msg = "成功";
        this.result = reslut;
    }

    /**
     * 自定义 errcode 和 msg<br>
     *
     * @param errcode
     * @param msg
     */
    public Response(int errcode, String msg) {
        this.errcode = errcode;
        this.msg = msg;
    }

    /**
     * 自定义 errcode , msg 和 data<br>
     *
     * @param errcode
     * @param msg
     * @param reslut
     */
    public Response(int errcode, String msg, Object reslut) {
        this.errcode = errcode;
        this.msg = msg;
    }
}
